type DeepReadonlyX = {
  x: {
    a: 1
    b: 'hi'
  }
  y: 'hey'
}

type DeepReadonlyExpected = {
  readonly x: {
    readonly a: 1
    readonly b: 'hi'
  }
  readonly y: 'hey'
}

type DeepReadonlyTodo = DeepReadonly<DeepReadonlyX> // should be same as `Expected`

type DeepReadonly<T> = T extends object ? { readonly [K in keyof T]: T[K] extends object ? DeepReadonly<T[K]> : T[K] } : T